﻿using RTW.Core.Datas;
using RTW.Core.Ioc;
using RTW.Models;
using System;
using System.Collections.Generic;
using System.Text;

namespace RTW.Servers
{
   public  class UserServer: BaseDAL<TUserInfo>, IAutoInject
    {

        public TUserInfo Login(string UserAccount, string UserPwd, string DMID)
        {
            //return base.GetByOne(m => (m.UserAccount == UserAccount && m.UserPwd == UserPwd && m.DMID == DMID));

           return DbType.DB().Select<TUserInfo>()
                .LeftJoin(a=>a.DM.ID==a.DMID)
                .LeftJoin(a=>a.Org.ID==a.OrgID)
                .LeftJoin(a => a.Role.ID == a.RoleID)
                .Where(m => (m.UserAccount == UserAccount && m.UserPwd == UserPwd && m.DMID == DMID)).First();
        }
    }
}
